<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE HTML>
<html>
<head>
<base href="<%=basePath%>">

<title>角色管理</title>
<link rel="stylesheet" type="text/css"
	href="<%=basePath%>jslib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="<%=basePath%>css/theme.css">
<link rel="stylesheet"
	href="<%=basePath%>jslib/font-awesome/css/font-awesome.css">
<script src="<%=basePath%>jslib/jquery-1.7.2.min.js"
	type="text/javascript"></script>

</head>

<body class="content1">
	<div class="header">
		<h1 class="page-title">角色管理</h1>
	</div>
	<ul class="breadcrumb">
		<li><a href="<%=basePath%>showindex" target="_parent">Home</a> <span class="divider">/</span>
		</li>
		<li class="active">角色列表</li>
	</ul>
	<div class="container-fluid">
		<div class="row-fluid">
			<form class="form-inline" method="post"
				action="">
				<input class="input-xlarge" placeholder="功能名称..." name="searchname"
					type="text"> <input class="btn icon-search" type="submit"
					value="查询" /> <a class="btn btn-primary" href="role/showadd">新增
				</a>
			</form>

			<div class="well">
				<table class="table">
					<thead>
						<tr>
							<th>角色ID</th>
							<th>角色状态</th>
							<th>角色名称</th>
							<th>系统控制权限</th>
							<th>后台登录权限</th>
							<th>用户管理权限</th>
							<th>产品控制权限</th>
							<th>查看物品权限</th>
							<th>文件控制权限</th>
						</tr>
					</thead>
					<tbody>
						<c:forEach items="${roles}" var="item">
							<tr>
								<td>${item.id}</td>
								<td><c:choose>
										<c:when test="${item.state==1}">
											<p style="color: red;">正常</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								<td>${item.name}</td>

								<td><c:choose>
										<c:when test="${item.sysctrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><c:choose>
										<c:when test="${item.loginctrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><c:choose>
										<c:when test="${item.userctrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><c:choose>
										<c:when test="${item.productctrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><c:choose>
										<c:when test="${item.goodcheckctrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><c:choose>
										<c:when test="${item.filectrl==1}">
											<p style="color: red;">拥有</p>
										</c:when>
										<c:otherwise>锁定</c:otherwise>
									</c:choose></td>
								
								<td><a href="<%=basePath %>role/showedit?theid=${item.id }">编辑</a>
								</td>
								

							</tr>
						</c:forEach>
					</tbody>
				</table>

			</div>
		</div>
	</div>
</body>
</html>
